/**
 * Created with IntelliJ IDEA.
 * Description: 数一下 1到 100 的所有整数中出现多少个数字9
 * User: 15085202591
 * Date: 2022-10-31
 * Time: 10:02
 */
public class StatisticsNine {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 1; i <= 100; i++) {
            if(i / 10 == 9 || i % 10 == 9){
                System.out.print(i + " ");
                count++;
            }
        }
        System.out.println();
        System.out.println("出现9的个数为：" + count);
    }
}
